import { createI18n } from 'vue-i18n';
import { Locale } from 'vant';
import VantZhTW from 'vant/es/locale/lang/zh-TW';
import AppTw from './zh-TW';

const locale = 'zh_TW';
Locale.use(locale, VantZhTW);

export let i18n;

export const setupI18n = app => {
  i18n = createI18n({
    legacy: false,
    locale,
    messages: {
      zh_TW: Object.assign(VantZhTW, AppTw),
    },
  });
  app.use(i18n);
};
